﻿using EFCore.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SIService;
using SService;

namespace WMSWeb.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SalesorderdetailController : ControllerBase
    {
        private readonly WmssystemContext myDb;
        private readonly SalesorderdetailS salesorderdetailS;

        public SalesorderdetailController(WmssystemContext myDb, SService.SalesorderdetailS salesorderdetailS)
        {
            this.myDb = myDb;
            this.salesorderdetailS = salesorderdetailS;
        }
        /// <summary>
        /// 销售明细添加
        /// </summary>
        /// <returns></returns>
        /// 
        [HttpPost]
        public async Task<int> Add(PO_Salesorderdetail pO_Salesorderdetail)
        {
            return await salesorderdetailS.Add(pO_Salesorderdetail);
        }
        /// <summary>
        /// 销售明细查询
        /// </summary>
        /// <returns></returns>
        /// 
        [HttpGet]
        public async Task<List<PO_Salesorderdetail>> Qu(string dh)
        {
            return await salesorderdetailS.Qu(dh);
        }
    }
}
